from django_filters.rest_framework import FilterSet
from django_filters.filters import *

from apps.trff.models import Plan


class PlanFilter(FilterSet):
    create_start_date = DateFilter(field_name='create_time', lookup_expr='gte', label='录入开始日期')
    create_end_date = DateFilter(field_name='create_time', lookup_expr='lt', label='录入结束日期')

    class Meta:
        model = Plan
        fields = ['number', 'creator',
                  'create_start_date', 'create_end_date']



__all__ = [

    'PlanFilter',
]
